import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue';
import RootView from '../views/RootView.vue';
import UserProfileView from '../views/UserProfileView.vue';
import HomeView from '../views/HomeView.vue';
import ArticleView from '../views/ArticleView.vue';
import NotifyView from '../views/NotifyView.vue';


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { 
      path: '/login', 
      name: 'Login', 
      component: LoginView 
    },
    {
      path: '/',
      name: 'Root',
      component: RootView,
      children: [
        { path: 'user', name: 'UserProfile', component: UserProfileView },
        { path: 'home', name: 'Home', component: HomeView },
        { path: 'article', name: 'Article', component: ArticleView },
        { path: 'notify', name: 'Notify', component: NotifyView }
      ]
    }
  ]
})

export default router
